package June;
import java.util.Scanner;
public class Test_6_2 {
    public static void main(String[] args) {
        //定义一个数组，并通过键盘向数组输入数据
        double[] arr = new double[5];
        //定义输入 Scanner
        Scanner myScanner = new Scanner(System.in);
        //使用for循环，输入5个数据
        for (int i = 0; i < arr.length; i++) {
            System.out.print("请输入第" + (i+1) + "个数字：");
            arr[i] = myScanner.nextDouble();
        }
        //输出，遍历数组
        System.out.println("以下是输出内容");
        for (int i = 0; i < arr.length; i++) {
            System.out.println("第" + (i + 1) + "个数字：" + arr[i]);
        }
    }
}
